package com.yuju.enums;
/**
 * 
 * 类名：wxPayReturnCodeEnum  <br />
 *
 * 功能：支付相关
 *
 * @author : sunyl <br />
 * @Date : 2018年1月8日 上午10:27:20  <br />
 * @version : 1.1 <br />
 */
public enum WxPayForScanReturnCodeEnum {
	PAY_SUCCESS("yuju-wxPay-1000", "支付成功"),
	USERPAYING("yuju-wxPay-1001", "正在支付"),
	PAY_FAILURE("yuju-wxPay-1002", "支付失败"),
	QUERY_SUCCESS("yuju-wxPay-1003", "支付查询成功"),
	QUERY_FAILURE("yuju-wxPay-1004", "支付查询失败"),
	RESERVE_SUCCESS("yuju-wxPay-1005", "订单已取消"),
	RESERVE_FAILURE("yuju-wxPay-1006", "订单取消失败"),
	PAY_OUTTIME_FAILURE("yuju-wxPay-1007", "订单超时"),
	REVERSE_SUCESS("yuju-wxPay-1008", "订单撤銷成功"),
	REVERSE_FAILURE("yuju-wxPay-1009", "订单撤銷失敗"),
	REFUND_SUCCESS("yuju-wxPay-1010", "订单退款成功"),
	REFUND_FAILURE("yuju-wxPay-1011", "订单退款失败");
	private String code;
	private String desc;
	
	WxPayForScanReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (WxPayForScanReturnCodeEnum enume : WxPayForScanReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}